Skip to content

Conversation

@whanso
Copy link
Contributor

@whanso whanso commented Oct 8, 2025

Defect: CDX-270

This fix updates the test to assert that the now parameter in the response is a ISO8601 formatted date string.

@whanso whanso requested review from Mudaafi and esezen as code owners October 8, 2025 11:14
Copy link

@VincentGalloro VincentGalloro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@esezen esezen requested a review from Copilot October 13, 2025 16:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes Java test cases to properly validate that the now parameter in API responses is returned as an ISO8601 formatted date string instead of a Unix timestamp.

  • Updates test assertions to expect ISO8601 date format instead of Unix timestamp format
  • Replaces DecimalFormat-based assertion with direct string comparison

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ConstructorIOSearchTest.java Updates search test to assert ISO8601 formatted now parameter
ConstructorIOBrowseTest.java Updates browse test to assert ISO8601 formatted now parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

UserInfo userInfo = new UserInfo(3, "c62a-2a09-faie");
SearchRequest request = new SearchRequest("Jacket");
String now = "1659053211";
String returnedNow = "2022-07-29T00:06:51+00:00";
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded ISO8601 timestamp creates a brittle test that will fail if the API returns a different but valid timestamp. Consider using a pattern matcher or date parsing to validate the ISO8601 format instead of exact string comparison.

Copilot uses AI. Check for mistakes.
UserInfo userInfo = new UserInfo(3, "c62a-2a09-faie");
BrowseRequest request = new BrowseRequest("Brand", "XYZ");
String now = "1659053211";
String returnedNow = "2022-07-29T00:06:51+00:00";
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded ISO8601 timestamp creates a brittle test that will fail if the API returns a different but valid timestamp. Consider using a pattern matcher or date parsing to validate the ISO8601 format instead of exact string comparison.

Copilot uses AI. Check for mistakes.
@esezen esezen merged commit 83b0cef into master Oct 13, 2025
3 of 4 checks passed
@esezen esezen deleted the CDX-270-java-fix-now-parameter-tests branch October 13, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants